package com.lgh.hotel.controller;

import com.lgh.hotel.dao.pojo.GuestServer;
import com.lgh.hotel.service.RoomServerServer;
import com.lgh.hotel.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@Api(tags = "服务模块")
@RestController
@RequestMapping("server")
public class RoomServerController {
    @Autowired
    RoomServerServer roomServerServer;

    @ApiOperation(value = "insert")
    @PostMapping("/insert")
    public Result insert(@RequestBody GuestServer params) {
        params.setCreateTime(new Date());
        roomServerServer.insert(params);
        return Result.succ();
    }

    @ApiOperation(value = "update")
    @PostMapping("/update")
    public Result update(@RequestBody GuestServer params) {
        roomServerServer.update(params);
        return Result.succ();
    }



    @ApiOperation(value = "select")
    @PostMapping("/select")
    public Result select(@RequestBody GuestServer params) {
        return Result.succ(roomServerServer.select(params));
    }


}
